package com.newbingo.service;

import com.newbingo.dao.imple.IOperatorPerviewDao;
import com.newbingo.dao.imple.IPerviewDao;
import com.newbingo.entity.OperatorPerview;
import com.newbingo.entity.Perview;


public class OperatorPerviewService {
	private IOperatorPerviewDao operatorPerviewDao;
	private IPerviewDao perviewDao;

	/*
	 * 保存操作员权限
	 * 
	 */
	public void saveOperatorPerview(Integer operatorId,String perviewsStr){
		operatorPerviewDao.deleteByOperatorId(operatorId);
		String[] perviews=perviewsStr.split(",");
		for(String s:perviews){
			int perviewId=Integer.parseInt(s);
			OperatorPerview oppw=new OperatorPerview();
			Perview perview=perviewDao.findById(perviewId);
			oppw.setPerview(perview);
			operatorPerviewDao.save(oppw);
		}
	}

	public IOperatorPerviewDao getOperatorPerviewDao() {
		return operatorPerviewDao;
	}

	public void setOperatorPerviewDao(IOperatorPerviewDao operatorPerviewDao) {
		this.operatorPerviewDao = operatorPerviewDao;
	}
	
	public IPerviewDao getPerviewDao() {
		return perviewDao;
	}

	public void setPerviewDao(IPerviewDao perviewDao) {
		this.perviewDao = perviewDao;
	}

}
